#ifndef _DB_QUEUE_HPP_20120610
#define _DB_QUEUE_HPP_20120610

#include "connection.hpp"
#include "db_cmd.hpp"

using namespace mina;
using namespace cmd;

class DBRequest
{
	public :
		DBRequest()
		{
		}

		DBRequest(const DBReq & req)
			: _req(req)
		{
		}

		~DBRequest() {}

	public :
		ConnID   _conn_id;
		DBReq    _req;
};

class DBResponse
{
	public :
		DBResponse()
			: _conn_id(0)
		{
		}

		DBResponse(const DBRequest & request)
		{
			_conn_id        = request._conn_id;
			_res._sequence  = request._req._sequence;
		}

		DBResponse & operator = (const DBRequest & request)
		{
			_conn_id          = request._conn_id;
			_res._sequence    = request._req._sequence;
			return *this;
		}

		DBResponse & operator = (const DBResponse & response)
		{
			_conn_id          = response._conn_id;
			_res._sequence    = response._res._sequence;
			return *this;
		}

		~DBResponse() {}

	public :
		ConnID    _conn_id; 
		DBRes     _res;
};

#endif

